home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / gtk-2.0 / gdk / gdkimage.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-25  |  4.2 KB  |  134 lines

  1. /* GDK - The GIMP Drawing Kit
  2.  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3.  *
  4.  * This library is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU Lesser General Public
  6.  * License as published by the Free Software Foundation; either
  7.  * version 2 of the License, or (at your option) any later version.
  8.  *
  9.  * This library is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.  * Lesser General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU Lesser General Public
  15.  * License along with this library; if not, write to the
  16.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.  * Boston, MA 02111-1307, USA.
  18.  */
  19.  
  20. /*
  21.  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
  22.  * file for a list of people on the GTK+ Team.  See the ChangeLog
  23.  * files for a list of changes.  These files are distributed with
  24.  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  25.  */
  26.  
  27. #ifndef __GDK_IMAGE_H__
  28. #define __GDK_IMAGE_H__
  29.  
  30. #include <gdk/gdktypes.h>
  31.  
  32. G_BEGIN_DECLS
  33.  
  34. /* Types of images.
  35.  *   Normal: Normal X image type. These are slow as they involve passing
  36.  *         the entire image through the X connection each time a draw
  37.  *         request is required. On Win32, a bitmap.
  38.  *   Shared: Shared memory X image type. These are fast as the X server
  39.  *         and the program actually use the same piece of memory. They
  40.  *         should be used with care though as there is the possibility
  41.  *         for both the X server and the program to be reading/writing
  42.  *         the image simultaneously and producing undesired results.
  43.  *         On Win32, also a bitmap.
  44.  */
  45. typedef enum
  46. {
  47.   GDK_IMAGE_NORMAL,
  48.   GDK_IMAGE_SHARED,
  49.   GDK_IMAGE_FASTEST
  50. } GdkImageType;
  51.  
  52. typedef struct _GdkImageClass GdkImageClass;
  53.  
  54. #define GDK_TYPE_IMAGE              (gdk_image_get_type ())
  55. #define GDK_IMAGE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_IMAGE, GdkImage))
  56. #define GDK_IMAGE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_IMAGE, GdkImageClass))
  57. #define GDK_IS_IMAGE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_IMAGE))
  58. #define GDK_IS_IMAGE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_IMAGE))
  59. #define GDK_IMAGE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_IMAGE, GdkImageClass))
  60.  
  61. struct _GdkImage
  62. {
  63.   GObject parent_instance;
  64.  
  65.   /*< public >*/
  66.   
  67.   GdkImageType    type; /* read only. */
  68.   GdkVisual    *visual;        /* read only. visual used to create the image */
  69.   GdkByteOrder    byte_order; /* read only. */
  70.   gint        width; /* read only. */
  71.   gint        height; /* read only. */
  72.   guint16    depth; /* read only. */
  73.   guint16    bpp;            /* read only. bytes per pixel */
  74.   guint16    bpl;            /* read only. bytes per line */
  75.   guint16       bits_per_pixel; /* read only. bits per pixel */
  76.   gpointer    mem;
  77.  
  78.   GdkColormap  *colormap; /* read only. */
  79.  
  80.   /*< private >*/
  81.   gpointer windowing_data; /* read only. */
  82. };
  83.  
  84. struct _GdkImageClass
  85. {
  86.   GObjectClass parent_class;
  87. };
  88.  
  89. GType     gdk_image_get_type   (void) G_GNUC_CONST;
  90.  
  91. GdkImage*  gdk_image_new       (GdkImageType  type,
  92.                 GdkVisual    *visual,
  93.                 gint          width,
  94.                 gint          height);
  95.  
  96. #ifndef GDK_DISABLE_DEPRECATED
  97. GdkImage*  gdk_image_get       (GdkDrawable  *drawable,
  98.                 gint          x,
  99.                 gint          y,
  100.                 gint          width,
  101.                 gint          height);
  102.  
  103. GdkImage * gdk_image_ref       (GdkImage     *image);
  104. void       gdk_image_unref     (GdkImage     *image);
  105. #endif
  106.  
  107. void       gdk_image_put_pixel (GdkImage     *image,
  108.                 gint          x,
  109.                 gint          y,
  110.                 guint32          pixel);
  111. guint32       gdk_image_get_pixel (GdkImage     *image,
  112.                 gint          x,
  113.                 gint          y);
  114.  
  115. void       gdk_image_set_colormap (GdkImage    *image,
  116.                                    GdkColormap *colormap);
  117. GdkColormap* gdk_image_get_colormap (GdkImage    *image);
  118.  
  119.  
  120. #ifdef GDK_ENABLE_BROKEN
  121. GdkImage* gdk_image_new_bitmap (GdkVisual     *visual,
  122.                 gpointer      data,
  123.                 gint          width,
  124.                 gint          height);
  125. #endif /* GDK_ENABLE_BROKEN */
  126.  
  127. #ifndef GDK_DISABLE_DEPRECATED
  128. #define gdk_image_destroy              gdk_image_unref
  129. #endif /* GDK_DISABLE_DEPRECATED */
  130.  
  131. G_END_DECLS
  132.  
  133. #endif /* __GDK_IMAGE_H__ */
  134.